/* 文档容器样式 */
.doc-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #f8f9fa;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 文档头部样式 */
.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background-color: #fff;
  border-bottom: 1px solid #e9ecef;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.doc-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.doc-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.doc-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #212529;
}

.doc-title-section {
  display: flex;
  flex-direction: column;
}

.doc-subtitle {
  font-size: 14px;
  color: #6c757d;
  margin-top: 4px;
}

.search-group {
  width: 300px;
}

.search-input {
  flex: 1;
}

.add-button {
  margin-left: 12px;
}

.back-button {
  margin-right: 8px;
}

/* 文档内容区域样式 */
.doc-content {
  flex: 1;
  padding: 24px;
  overflow: auto;
}

.doc-search {
  margin-bottom: 24px;
}

.doc-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.doc-item {
  display: flex;
  align-items: center;
  padding: 16px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.doc-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.doc-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-right: 16px;
  background-color: #f1f3f4;
  border-radius: 8px;
  color: #5f6368;
}

.doc-item-content {
  flex: 1;
}

.doc-item-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 500;
  color: #202124;
}

.doc-item-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #5f6368;
}

.doc-item-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.doc-item-actions {
  display: flex;
  gap: 8px;
}

.doc-pagination {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

/* 向量检索结果样式 */
.vector-result-container {
  padding: 16px 24px;
}

.vector-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.vector-result-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: #202124;
}

.vector-result-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vector-item {
  padding: 12px 16px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border-left: 3px solid #4285f4;
}

.vector-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.vector-item-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: #202124;
}

.vector-item-content {
  font-size: 14px;
  color: #5f6368;
  line-height: 1.5;
}

/* 向量抽屉样式 */
.vector-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 50vh;
  background-color: white;
  border-top: 1px solid #e9ecef;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  /* 移除 z-index: 1000; */
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.vector-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #e9ecef;
  background-color: #f8f9fa;
}

.vector-drawer-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #212529;
}

.vector-drawer-content {
  padding: 16px 24px;
  max-height: calc(50vh - 60px);
  overflow-y: auto;
}

.vector-item {
  padding: 12px;
  background-color: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 12px;
}

.vector-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.vector-item-index {
  font-weight: 600;
  color: #4285f4;
}

.vector-item-score {
  font-size: 12px;
}

.vector-item-content {
  color: #333;
  line-height: 1.5;
}

.vector-empty {
  padding: 20px;
  text-align: center;
}

/* 文档上传模态框样式 */
.upload-modal .upload-modal-card {
  width: 600px;
}

.upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  background-color: #f9fafb;
  transition: all 0.2s ease;
  cursor: pointer;
}

.upload-area:hover {
  border-color: #4285f4;
  background-color: #f0f7ff;
}

.upload-area.dragover {
  border-color: #4285f4;
  background-color: #e8f0fe;
}

.upload-icon {
  font-size: 48px;
  color: #9ca3af;
  margin-bottom: 16px;
}

.upload-text {
  font-size: 16px;
  color: #374151;
  margin-bottom: 8px;
}

.upload-hint {
  font-size: 14px;
  color: #6b7280;
}

.file-list {
  margin-top: 16px;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background-color: #f9fafb;
  border-radius: 6px;
  margin-bottom: 8px;
}

.file-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-name {
  font-weight: 500;
  color: #374151;
}

.file-size {
  font-size: 13px;
  color: #6b7280;
}

.file-remove {
  color: #ef4444;
  cursor: pointer;
}

/* 文档查看模态框样式 */
.doc-modal .doc-modal-card {
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
}

.doc-view-modal .doc-modal-card {
  width: 90%;
  max-width: 1200px;
}

.doc-view-container {
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.doc-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 16px;
}

.doc-view-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #212529;
}

.doc-view-actions {
  display: flex;
  gap: 8px;
}

.doc-view-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.doc-view-main {
  flex: 2;
  overflow: auto;
  padding-right: 16px;
}

.doc-view-sidebar {
  flex: 1;
  overflow: auto;
  border-left: 1px solid #e9ecef;
  padding-left: 16px;
}

.doc-info-section {
  margin-bottom: 24px;
}

.doc-info-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: #212529;
}

.doc-info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #495057;
}

.doc-toc {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doc-toc-item {
  padding: 4px 0;
}

.doc-toc-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #495057;
  text-decoration: none;
  font-size: 14px;
}

.doc-toc-link:hover {
  color: #4285f4;
}

/* 图片预览模态框样式 */
.image-preview-modal .image-preview-card {
  width: 90%;
  max-width: 900px;
}

.image-preview-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.preview-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 模态框通用样式 */
.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  color: #212529;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 文档内容样式 */
.document-content {
  line-height: 1.6;
  color: #333;
  font-size: 15px;
}

.document-content h1, .document-content h2, .document-content h3, 
.document-content h4, .document-content h5, .document-content h6 {
  margin-top: 24px;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.document-content h1 {
  font-size: 28px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.document-content h2 {
  font-size: 22px;
}

.document-content h3 {
  font-size: 18px;
}

.document-content p {
  margin-bottom: 16px;
}

.document-content ul, .document-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.document-content li {
  margin-bottom: 8px;
}

.document-content blockquote {
  margin: 16px 0;
  padding: 8px 16px;
  background-color: #f8f9fa;
  border-left: 4px solid #4285f4;
  color: #495057;
}

.document-content code {
  background-color: #f1f3f4;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9em;
}

.document-content pre {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.document-content pre code {
  background-color: transparent;
  padding: 0;
}

.document-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.document-content th, .document-content td {
  border: 1px solid #e9ecef;
  padding: 8px 12px;
  text-align: left;
}

.document-content th {
  background-color: #f8f9fa;
  font-weight: 600;
}

.document-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 16px 0;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.document-content img:hover {
  transform: scale(1.02);
}

/* 状态标签样式 */
.status-tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
}

.status-success {
  background-color: #d4edda;
  color: #155724;
}

.status-error {
  background-color: #f8d7da;
  color: #721c24;
}

.status-warning {
  background-color: #fff3cd;
  color: #856404;
}

.status-default {
  background-color: #e2e3e5;
  color: #383d41;
}

/* 文档分享模态框样式 */
.share-modal .share-modal-card {
  width: 90%;
  max-width: 600px;
}

.share-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.share-section {
  margin-bottom: 16px;
}

.share-section-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: #212529;
}

.share-link-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-link {
  flex: 1;
  padding: 8px 12px;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  font-size: 14px;
  color: #495057;
  word-break: break-all;
}

.share-actions {
  display: flex;
  gap: 8px;
}

.share-tip {
  font-size: 13px;
  color: #6c757d;
  margin-top: 8px;
}

/* 文件类型标签样式 */
.file-type-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.file-type-pdf {
  background-color: #fee2e2;
  color: #dc2626;
}

.file-type-doc {
  background-color: #dbeafe;
  color: #2563eb;
}

.file-type-xls {
  background-color: #dcfce7;
  color: #16a34a;
}

.file-type-ppt {
  background-color: #fef3c7;
  color: #d97706;
}

.file-type-txt {
  background-color: #f3f4f6;
  color: #374151;
}

.file-type-md {
  background-color: #e9d5ff;
  color: #9333ea;
}

.file-type-img {
  background-color: #fce7f3;
  color: #ec4899;
}

.file-type-video {
  background-color: #ecfdf5;
  color: #059669;
}

.file-type-audio {
  background-color: #f0fdf4;
  color: #15803d;
}

.file-type-zip {
  background-color: #f5f3ff;
  color: #7c3aed;
}

.file-type-code {
  background-color: #1e293b;
  color: #f8fafc;
}

/* Markdown预览样式 */
.markdown-preview {
  margin-top: 16px;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  overflow: hidden;
}

.markdown-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.markdown-preview-title {
  font-size: 14px;
  font-weight: 600;
  color: #495057;
}

.markdown-preview-content {
  padding: 16px;
  max-height: 300px;
  overflow-y: auto;
  background-color: #fff;
}

.markdown-preview-content h1,
.markdown-preview-content h2,
.markdown-preview-content h3,
.markdown-preview-content h4,
.markdown-preview-content h5,
.markdown-preview-content h6 {
  margin-top: 0;
  margin-bottom: 12px;
}

.markdown-preview-content p {
  margin-bottom: 12px;
}

.markdown-preview-content ul,
.markdown-preview-content ol {
  margin-bottom: 12px;
  padding-left: 20px;
}

.markdown-preview-content li {
  margin-bottom: 4px;
}

.markdown-preview-content code {
  background-color: #f1f3f4;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9em;
}

.markdown-preview-content pre {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 12px;
  overflow-x: auto;
  margin-bottom: 12px;
}

.markdown-preview-content pre code {
  background-color: transparent;
  padding: 0;
}

.markdown-preview-content blockquote {
  margin: 12px 0;
  padding: 8px 16px;
  background-color: #f8f9fa;
  border-left: 4px solid #4285f4;
  color: #495057;
}

.markdown-preview-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  color: #6c757d;
}

/* 输入模式切换样式 */
.input-mode-switch {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

/* 文本输入模式样式 */
.text-input-area {
  margin-bottom: 20px;
}

.title-input {
  margin-bottom: 10px;
  width: 100%;
}

.content-input {
  width: 100%;
  resize: vertical;
}

/* 内容预览区域样式 */
.content-preview-section {
  margin-top: 20px;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 500;
  color: #495057;
}

.content-preview {
  border: 1px solid #e9ecef;
  border-radius: 6px;
  overflow: hidden;
}

.text-preview {
  padding: 16px;
  max-height: 300px;
  overflow-y: auto;
  background-color: #fff;
  font-family: 'Consolas', 'Monaco', monospace;
  white-space: pre-wrap;
  word-break: break-all;
}

.text-preview pre {
  margin: 0;
  font-family: inherit;
}

.preview-content {
  padding: 16px;
  max-height: 300px;
  overflow-y: auto;
  background-color: #fff;
}

.preview-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  color: #6c757d;
  gap: 8px;
}

/* 文件信息展示样式 */
.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background-color: #f8f9fa;
  border-radius: 6px;
  margin-top: 12px;
}

.file-info-icon {
  font-size: 24px;
  color: #495057;
}

.file-info-details {
  flex: 1;
}

.file-info-name {
  font-weight: 500;
  color: #212529;
  margin-bottom: 4px;
}

.file-info-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #6c757d;
}

.file-info-size,
.file-info-type {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 拖拽上传样式 */
.upload-area.drag-over {
  border-color: #4285f4;
  background-color: #f8f9ff;
}

.upload-area.drag-over .upload-icon {
  color: #4285f4;
}

.upload-area.drag-over .upload-text {
  color: #4285f4;
}

/* 文件上传区域样式 */
.upload-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background-color: #f8f9fa;
  border-radius: 6px;
}

.upload-file-info {
  flex: 1;
}

.upload-file-name {
  font-weight: 500;
  color: #212529;
  margin-bottom: 4px;
}

.upload-file-size {
  font-size: 13px;
  color: #6c757d;
}

/* 文档分享相关样式 */
.share-document-info {
  margin-bottom: 16px;
}

.share-document-title {
  font-size: 16px;
  font-weight: 600;
  color: #212529;
  margin-bottom: 8px;
}

.share-document-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #6c757d;
}

.share-link-section {
  margin-bottom: 16px;
}

.share-link-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 500;
  color: #495057;
}

.share-link-input {
  display: flex;
  gap: 8px;
}

.share-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.share-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.share-tips {
  margin-top: 16px;
}

/* 空状态样式 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .doc-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .doc-header-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  .doc-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .doc-item-icon {
    margin-right: 0;
    margin-bottom: 12px;
  }
  
  .doc-item-actions {
    margin-top: 12px;
    width: 100%;
    justify-content: flex-end;
  }
  
  .doc-view-content {
    flex-direction: column;
  }
  
  .doc-view-main {
    padding-right: 0;
    margin-bottom: 16px;
  }
  
  .doc-view-sidebar {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid #e9ecef;
    padding-top: 16px;
  }
  
  .doc-modal .doc-modal-card {
    width: 95%;
    max-height: 95vh;
  }
  
  .image-preview-modal .image-preview-card {
    width: 95%;
  }
  
  .share-modal .share-modal-card {
    width: 95%;
  }
}

/* 动画效果 */
.slide-up-enter-active,
.slide-up-leave-active {
  transition: transform 0.3s ease;
}

.slide-up-enter-from {
  transform: translateY(100%);
}

.slide-up-leave-to {
  transform: translateY(100%);
}

/* 文档宫格卡片样式 */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px;
}

.doc-card {
  background: var(--n-card-color);
  border: 1px solid var(--n-border-color);
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  position: relative;
}

.doc-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-color: var(--n-primary-color);
}

.doc-card-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
  color: var(--n-primary-color);
}

.doc-card-content {
  flex: 1;
}

.doc-card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--n-text-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-card-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.doc-card-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--n-text-color-3);
}

.doc-card-status {
  margin-bottom: 15px;
}

.doc-card-actions {
  display: flex;
  justify-content: center;
  padding-top: 10px;
  border-top: 1px solid var(--n-divider-color);
}

.doc-card-actions .n-button-group {
  width: 100%;
}

.doc-card-actions .n-button {
  flex: 1;
}

/* 空状态样式 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--n-text-color-3);
}

.empty-state .n-icon {
  margin-bottom: 16px;
  color: var(--n-text-color-3);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .doc-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    padding: 15px;
  }
  
  .doc-card {
    padding: 15px;
  }
  
  .doc-card-title {
    font-size: 14px;
  }
  
  .doc-card-meta-item {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .doc-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }
  
  .doc-card {
    padding: 12px;
  }
}